Fix desktop menu docs links regression#7181
Conversation
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/05/2025, 10:30:46 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
📝 WalkthroughWalkthrough
Changes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (10)**/*.{vue,ts,tsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{ts,tsx,js,vue}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{ts,tsx,js,jsx,vue}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
tests-ui/**/*.test.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (tests-ui/CLAUDE.md)
Files:
**/*.{test,spec}.{ts,tsx,js}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/composables/use*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (18)📓 Common learnings📚 Learning: 2025-11-24T19:46:52.279ZApplied to files:
📚 Learning: 2025-11-24T19:47:34.324ZApplied to files:
📚 Learning: 2025-11-24T19:47:02.860ZApplied to files:
📚 Learning: 2025-11-24T19:47:45.616ZApplied to files:
📚 Learning: 2025-11-24T19:48:03.270ZApplied to files:
📚 Learning: 2025-11-24T19:48:03.270ZApplied to files:
📚 Learning: 2025-11-24T19:48:03.270ZApplied to files:
📚 Learning: 2025-11-24T19:46:52.279ZApplied to files:
📚 Learning: 2025-11-24T19:48:03.270ZApplied to files:
📚 Learning: 2025-11-24T19:48:23.088ZApplied to files:
📚 Learning: 2025-11-24T19:48:23.088ZApplied to files:
📚 Learning: 2025-11-24T19:48:09.318ZApplied to files:
📚 Learning: 2025-11-24T19:48:09.318ZApplied to files:
📚 Learning: 2025-11-24T19:48:09.318ZApplied to files:
📚 Learning: 2025-11-24T19:47:56.371ZApplied to files:
📚 Learning: 2025-11-24T19:48:09.318ZApplied to files:
📚 Learning: 2025-11-24T19:48:09.318ZApplied to files:
🧬 Code graph analysis (1)tests-ui/tests/composables/useExternalLink.test.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Test Results⏰ Completed at: 12/05/2025, 10:39:47 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a desktop menu regression where docs links disappeared due to useExternalLink being called at module-eval time in electronAdapter. The fix makes the composable safe to use outside Vue setup context by accessing the global i18n locale directly instead of using the composition API's useI18n().
- Replaced
useI18n()call with direct access toi18n.global.localeinuseExternalLinkcomposable - Updated test mocks to align with the new implementation approach
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/composables/useExternalLink.ts |
Changed to use i18n.global.locale instead of useI18n() to enable usage outside setup context |
tests-ui/tests/composables/useExternalLink.test.ts |
Updated mock to mock @/i18n module instead of vue-i18n to match new implementation |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.2 MB (baseline 3.2 MB) • 🔴 +35 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 975 kB (baseline 975 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 173 kB (baseline 173 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.81 MB (baseline 3.81 MB) • ⚪ 0 BBundles that do not match a named category
Status: 17 added / 17 removed |
| useI18n: vi.fn(() => ({ | ||
| locale: mockLocale | ||
| })) | ||
| vi.mock('@/i18n', () => ({ |
There was a problem hiding this comment.
You should be able to just createI18n as a plugin for the test
There was a problem hiding this comment.
actually this sounds somewhat excessive, we only need i18n.global.locale.value, can you recheck? idm either way eod though
There was a problem hiding this comment.
## Summary - make `useExternalLink` rely on the global i18n locale so it can be used safely outside setup - restore `electronAdapter` to use the shared `useExternalLink` helper for docs URLs and static links ## Motivation Desktop menu items disappeared because a top-level call to `useExternalLink` in `electronAdapter` triggered `useI18n` at module-eval time, throwing and blocking extension registration. By making the composable global-locale-only and using it in `electronAdapter`, the module can load without setup context while preserving link behavior. ## Testing - pnpm typecheck - pnpm lint:fix ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7181-Fix-desktop-menu-docs-links-regression-2c06d73d36508157ae48cff078b9173e) by [Unito](https://www.unito.io)
|
@benceruleanlu Successfully backported to #7278 |
Backport of #7181 to `core/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7278-backport-core-1-33-Fix-desktop-menu-docs-links-regression-2c46d73d36508115ab76e36fa53cd5d8) by [Unito](https://www.unito.io) Co-authored-by: Benjamin Lu <benjaminlu1107@gmail.com>
## Summary - make `useExternalLink` rely on the global i18n locale so it can be used safely outside setup - restore `electronAdapter` to use the shared `useExternalLink` helper for docs URLs and static links ## Motivation Desktop menu items disappeared because a top-level call to `useExternalLink` in `electronAdapter` triggered `useI18n` at module-eval time, throwing and blocking extension registration. By making the composable global-locale-only and using it in `electronAdapter`, the module can load without setup context while preserving link behavior. ## Testing - pnpm typecheck - pnpm lint:fix ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7181-Fix-desktop-menu-docs-links-regression-2c06d73d36508157ae48cff078b9173e) by [Unito](https://www.unito.io) (cherry picked from commit 41eb457)
## Summary - make `useExternalLink` rely on the global i18n locale so it can be used safely outside setup - restore `electronAdapter` to use the shared `useExternalLink` helper for docs URLs and static links ## Motivation Desktop menu items disappeared because a top-level call to `useExternalLink` in `electronAdapter` triggered `useI18n` at module-eval time, throwing and blocking extension registration. By making the composable global-locale-only and using it in `electronAdapter`, the module can load without setup context while preserving link behavior. ## Testing - pnpm typecheck - pnpm lint:fix ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7181-Fix-desktop-menu-docs-links-regression-2c06d73d36508157ae48cff078b9173e) by [Unito](https://www.unito.io)
|
@benceruleanlu Successfully backported to #7501 |
Backport of #7181 to `core/1.34` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7501-backport-core-1-34-Fix-desktop-menu-docs-links-regression-2ca6d73d365081bc8785ecc142e9c729) by [Unito](https://www.unito.io) Co-authored-by: Benjamin Lu <benjaminlu1107@gmail.com>
## Summary - make `useExternalLink` rely on the global i18n locale so it can be used safely outside setup - restore `electronAdapter` to use the shared `useExternalLink` helper for docs URLs and static links ## Motivation Desktop menu items disappeared because a top-level call to `useExternalLink` in `electronAdapter` triggered `useI18n` at module-eval time, throwing and blocking extension registration. By making the composable global-locale-only and using it in `electronAdapter`, the module can load without setup context while preserving link behavior. ## Testing - pnpm typecheck - pnpm lint:fix ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7181-Fix-desktop-menu-docs-links-regression-2c06d73d36508157ae48cff078b9173e) by [Unito](https://www.unito.io)
Summary
useExternalLinkrely on the global i18n locale so it can be used safely outside setupelectronAdapterto use the shareduseExternalLinkhelper for docs URLs and static linksMotivation
Desktop menu items disappeared because a top-level call to
useExternalLinkinelectronAdaptertriggereduseI18nat module-eval time, throwing and blocking extension registration. By making the composable global-locale-only and using it inelectronAdapter, the module can load without setup context while preserving link behavior.Testing
┆Issue is synchronized with this Notion page by Unito